package profiler.parameters.monitors;

import org.hyperic.sigar.DiskUsage;
import org.hyperic.sigar.Sigar;
import org.hyperic.sigar.SigarException;

public class DiskUsageParameter extends GenericParameter {

	private static DiskUsage diskUsage;
	private static String id;
	protected static Sigar sigarValue = new Sigar();
	
	private static final double MEGA = 1024.0;
	
	public DiskUsageParameter(String diskName) throws SigarException {
		super(id, sigarValue);
		diskUsage = sigarValue.getDiskUsage(diskName);
	}

	public String generateReport() {
		String report = "Queue: "+ diskUsage.getQueue() + "\n" + 
				"Reads: " + diskUsage.getReads()/MEGA + " MB" + "\n" + 
				"Read bytes: " + diskUsage.getReadBytes() + " Bytes" + "\n";
		return report;
	}

}
